<?php
/*
	提现
 * [JINYUN!] (C)2001-2099 Jinyunweb.com
 * This is NOT a freeware, use is subject to license terms
 * $Id: 2017-12-13 03:39:35 apple $
*/
defined('BY_JYA') or exit('error');
global $_RQ;
$_RQ['op']=$_RQ['op']?$_RQ['op']:'get';
cfc('core')->checklogin();
$feetype=$_RQ['type'];
$feetitle=$this->fee_types[$feetype];
$return['feetitle']=$feetitle;
if($_RQ['op']=='get'){
	$member=pdo_get('core_members',array('id'=>$_SESSION['uid']));
	$params=array('uniacid'=>$_SESSION['uniacid'],'mid'=>$_SESSION['uid'],'type'=>0);
	$member['feeall']=pdo_getsum('jy_shopnewfee_commission',$params,'money');	
	$return['member']=$member;
	$return['params']['type']=$feetype;
	set_html('title','我的'.$feetitle);
	exi($return);
}
if($_RQ['op']=='list'){
	$return=array();
	$pindex = max(1, intval($_RQ['page']));
	$psize = 15;
	$params=array('uniacid'=>$_SESSION['uniacid'],'mid'=>$_SESSION['uid']);
    $orderby='createtime desc';
	$total='';
	if(isset($_RQ['type'])){
		$params['type']=intval($_RQ['type']);
	}
	$return['list']=pdo_getslice('jy_shopnewfee_commission',$params,array($pindex,$psize),$total,$fields,'',$orderby);	
	foreach($return['list'] as &$v){
			$v['createtime']=date('Y-m-d H:m:s',$v['createtime']);
			$v['typetitle']=$feetitle;
			$v['statustitle']=$this->commission_status[$v['status']];
	}
	exi($return);
}